package com.zhss.eshop.auth.mapper;

import com.zhss.eshop.auth.domain.model.AuthRolePriorityRelationship;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface AuthRolePriorityRelationshipMapper {
    int deleteByPrimaryKey(Long id);

    int insertSelective(AuthRolePriorityRelationship record);

    AuthRolePriorityRelationship selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(AuthRolePriorityRelationship record);
    /**
     * 根据权限id查询记录数
     * @param priorityId 权限id
     * @return 记录数
     */
    Long countByPriorityId(@Param("priorityId") Long priorityId);
    /**
     * 根据角色id查询角色和权限的关系
     * @param roleId 角色id
     * @return 角色权限关系DO对象集合
     */
    List<AuthRolePriorityRelationship> listByRoleId(
            @Param("roleId") Long roleId);
    /**
     * 根据角色id删除角色权限关联关系
     * @param roleId 角色id
     */
    void removeByRoleId(@Param("roleId") Long roleId);

}
